<template>
  <div class="wrapper" ref="wrapper">
    <div>
      <slot></slot>
    </div>
  </div>
</template>
<script>
  import BScroll from 'better-scroll';
  export default{
    name:'Scroll',
    data(){
      return{
        scroll:{
          type:Object,
          default(){
            return{}
          }
        }

      }
    },
    props:{
      probeType:{
        type:Number,
        default:0
      }
    },
    mounted(){
      this.scroll = new BScroll(this.$refs.wrapper,{
        probeType : this.probeType,
        click:true,
        pullUpLoad: true,
        scrollY:true

      }),
      this.scroll.on('scroll',position=>{
        this.$emit("scroll",position)
      }) 
    }
  }
</script>